<?php

namespace app\common\model;

use think\Model;

class Link extends Model
{
    //
    protected $pk='link_id';
    protected $table='blog_link';

    //添加友链
    public function store($data)
    {
        //数据校验和保存
       $res= $this->validate(true)->save($data);
        if($res){
            return ['valid'=>1,'msg'=>'添加成功'];
        }else{
            return ['valid'=>0,'msg'=>$this->getError()];
        }
    }
}
